//
//  YDSweetView.swift
//  weibo
//
//  Created by 孙亚东 on 16/6/28.
//  Copyright © 2016年 Sunyadong. All rights reserved.
//

import UIKit

class YDSweetView: UIView {
    
    
    //定义一个viewModel的属性，获取里面的
    
    var model: YDUserViewModel? {
    
        didSet {
        
        contentLab.text = model?.reweetString

       
        }
  
    }
    
    override init(frame: CGRect) {
        
        super.init(frame: frame)
        
        //设置颜色
        
        backgroundColor = UIColor.lightGrayColor()
        
        setupUI()
        
        
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
        
    }
    
    
    func setupUI () {
    
        addSubview(contentLab)
        
        
        // 设置约束
        contentLab.snp_makeConstraints { (make) -> Void in
            
            make.top.bottom.equalTo(self)
 
            make.left.equalTo(self).offset(10)
            make.right.equalTo(self).offset(-10)
            
        }
 
    }
    
    
    //懒加载控件
   private lazy var contentLab: UILabel = {
    
        let contentLab = UILabel()

        contentLab.numberOfLines = 0
    
        contentLab.font = UIFont.systemFontOfSize(13.0)
    
        return contentLab
    
    }()
    
    
    
}
